package com.mes.cloud.dao;

import com.mes.cloud.api.dto.request.menu.AllRejectButtonListRequest;
import com.mes.cloud.api.dto.request.menu.MenuPageListRequest;
import com.mes.cloud.api.dto.request.menu.SysMenuDatchDeleteRequest;
import com.mes.cloud.entity.SysMenu;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.ids.SelectByIdsMapper;

import java.util.List;
import java.util.Set;

/**
 * 系统菜单
 *
 * @author wxm
 * @email xiaomin.wu1@pactera.com
 * @version 2019-07-30 13:55:22
 */
public interface SysMenuDao  extends SelectByIdsMapper<SysMenu>, Mapper<SysMenu>{

    /**
     * 查看菜单 不包含按钮
     * @param allRejectButtonListRequest
     * @return
     */
    List<SysMenu> allRejectButtonList(AllRejectButtonListRequest allRejectButtonListRequest);

    /**
     * 查询菜单列表
     * @param menuPageListRequest
     * @return
     */
    List<SysMenu> list(MenuPageListRequest menuPageListRequest);

    /**
     * 按IDS查询菜单
     * @param ids
     * @return
     */
    List<SysMenu> listByIds(Set<String> ids);

    /**
     * 批量删除
     * @param sysMenuDatchDeleteRequest
     * @return
     */
    int batchDelete(SysMenuDatchDeleteRequest sysMenuDatchDeleteRequest);


    /**
     * 查询菜单的子菜单，按sort排序
     * @param sysMenuParam
     * @return
     */
    List<SysMenu> selectSort(SysMenu sysMenuParam);

    String getParentGroupById(String id);

    List<SysMenu> getSubMenuList(@Param("employeeId") String employeeId, @Param("parentGroupId") String parentGroupId, @Param("platform") String platform);

    List<SysMenu> getSubMenuListSN(@Param("employeeId") String employeeId, @Param("pid") String pid, @Param("platform") String platform);

    List<SysMenu> getSubMenuListAdmin(@Param("parentGroupId") String parentGroupId, @Param("platform") String platform);

    List<SysMenu> getSubMenuListAdminSN(@Param("pid") String pid, @Param("platform") String platform);

    String getParentSNById(String id);
}
